<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="br.org.group.web.fortunes.FortunesWebProvider" %>
<%@ page import="br.org.group.android.dao.FortunesDAO" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <!-- Metas -->
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="autor" content="Equipe Fortune" />
    <meta name='robots' content='all, follow' />
    <meta name="description" content="" />
    <meta name="keywords" content="" />

    <title>Froid</title>
    
    <!-- Favicon -->
    <link href='img/favicon.ico' rel='shortcut icon'/>
    <link href='img/favicon.png' rel='shortcut icon'/>
    <link href='img/favicon.png' rel='apple-touch-icon'/>
    <link href='img/favicon.png' rel='shortcut icon' type='image/x-icon'/>

    <!-- css -->
    <link href="css/style.css" rel="stylesheet" type="text/css" />

    <!-- js -->
    <script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/tooltip.js"></script>
    <script type="text/javascript" src="js/custom.js"></script>

</head>   
  
<body>
<%
			int id = 0;
			String msg, author = "";
			if((request.getParameter("id") != null) && (request.getParameter("id").trim() != "")){
				id = Integer.parseInt((String)request.getParameter("id").trim());
			}
			FortunesDAO fortunes = (new FortunesWebProvider()).getFortune(id);
		    if (fortunes == null) {
		    	msg = "Fortune não existente!";
		    }else{
		    		msg = fortunes.getMensagem().getValue();
		    		author = fortunes.getAutor().trim();
		    }

%>
  <div id="main">
  
    <!-- header -->
    <div id="header">
      <div id="logo">
        <div id="logo_text">
          <h1><a href="index.html"><span class="logo_colour">Froid</span></a></h1>
          <h2>Qual &eacute; sua sorte de hoje?</h2>
        </div>
      </div>
      <div id="menubar">
        <ul id="menu">
        </ul>
      </div>
    </div>
	
	<!-- content -->
    <div id="site_content">
      <div id="sidebar_container">
        
        <div class="sidebar">
          <div class="sidebar_item">
            
            <h3></h3>
            
              <p class="center">
                <a href="http://www.androidbrasilprojetos.org/"><img src="img/logo_android_brasil_projetos.png" /></a>
              </p>
            
			<h3></h3>
			
          </div>
        </div>
      </div>
      <h3><br />Fortune: <form action="?id=<%= ++id%>" method="post"> 
			<input type="submit" value="Atualizar" id="newFortune" class="refresh right tooltip" title="<div>ATUALIZAR</div>" />
      	</form></h3> 
      <div id="content">
            
            <h4><%= msg%> </h4>
            Autor: <h5><%= author%><br /><br /></h5>
      </div>
    </div>
	
	<!-- footer -->
    <div id="footer">
      <p>
		  <a href="https://docs.google.com/document/d/1BggP7WIeK7OsoKqjheg3sesOV7X6nND1pTDDn5zfMlM/edit?hl=pt_BR&authkey=CNisrNkN#" target="_blank">Google docs</a> | 
		  <a href="http://code.google.com/p/android-brasil-fortunes/" target="_blank">SVN</a> | 
		  <a href="http://www.androidbrasilprojetos.org/projetos-2/" target="_blank">Projetos do Grupo ABP</a> <br/> 
		  <a href="http://market.android.com/details?id=br.org.group.android.app" target="_blank"><h1><span style="color:green">Faça o download do apk pelo Android Market!</span></h1></a>
	  </p>
      <p>Copyright &copy; Equipe Fortune</p>

    </div>

  </div>
      <br/>
<div class="center">
		<script type="text/javascript"><!--
			google_ad_client = "ca-pub-4262958243212035";
			/* FortunesWeb2 */
			google_ad_slot = "8881696854";
			google_ad_width = 728;
			google_ad_height = 90;
			//-->
			</script>
			<script type="text/javascript"
			src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
		</script>
</div>
</body>
</html>
